package com.wyu.blog.service;

import com.wyu.blog.dao.CollectMapper;
import com.wyu.blog.entity.Collect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class CollectService {

    @Autowired
    private CollectMapper collectMapper;



    public List<Collect> findCollectByUserId(Integer userId) {
        return collectMapper.selectCollectById(userId);
    }

    public List<Collect> findNotCollect(Integer userId) {
        return collectMapper.selectNotCollect(userId);
    }

    public Integer findCollectNumById(Integer userId){
        return collectMapper.selectCollectNumById(userId);
    }

    public void deleteCollect(HashMap map) {
        collectMapper.deleteCollectById(map);
    }

    public Integer addCollect(Collect collect){
        return collectMapper.insertCollect(collect);
    }

}
